package br.com.felix.dbm.controller;

import java.util.TreeSet;

import br.com.felix.dbm.database.Table;

public class ColumnControllerSet extends TreeSet<ColumnController> {

	private static final long serialVersionUID = -8529037501763837338L;



	public ColumnControllerSet foreignKeysOfTable(Table table) {
		ColumnControllerSet ccs = new ColumnControllerSet();
		for (ColumnController cc : this) {
			if (cc.getModel().isForeignKey(table)) {
				ccs.add(cc);
			}
		}
		return ccs;
	}



	public TableSet getTableSet() {
		TableSet tcs = new TableSet();
		for (ColumnController cc : this) {
			tcs.add(cc.getModel().getTable());
		}
		return tcs;
	}



	public TableControllerSet getTableControllerSet() {
		TableControllerSet tcs = new TableControllerSet();
		for (ColumnController cc : this) {
			tcs.add(cc.getTableController());
		}
		return tcs;
	}
}
